home *** CD-ROM | disk | FTP | other *** search
- #**********************************************************************
- #
- # LOGIN.CMD v4.0
- #
- # Dialing Script for Trumpet Winsock
- #
- # Copyright (c) 1995 Cycor Communications Inc.
- #
- # Serial #07059502
- #
- #**********************************************************************
-
- #trace on # if debugging
- echo off
-
- # VARIABLE DEFINITIONS
- $datemade = "11-13-1995 16:52:11"
- $number = "416-350-3579"
- $d_prefix = ""
- $service = "3"
- $resetstr = "AT"
- $initstr = "AT&D2&C1X4Q0V1"
- $user = "cycor"
- $result = "cycor"
- $result1 = "cycor"
- $result2 = "cycor"
- %maxTries = 4
- %n = 0
- %n = 0
- %success = 0
-
-
- #
- # READ VARIABLES FROM TRUMPSWK.INI
- #
- # ATTEMPT TO LOAD USER INFORMATION
- if ![load $user]
- save $user
-
- end
-
- #
- # RESET MODEM
- #
- # CHECK MODEM
- %n = %maxTries
- display \n
- display \n
- display "Resetting modem.."
- repeat
- display "."
- output $resetstr\13
- %n = %n - 1
- if [input 5 OK\n]
- %success = 1
- else
- %success = 0
-
- end
-
- until %success | %n < 1
-
- # MODEM RESET OK
- if %success
- sleep 5
- display "Done."\n
- # MODEM FAILED TO RESET
- else
- display \007\n
- display "Modem failed to reset properly."\n
- display "Ensure your setup SLIP PORT is the correct COM port for your modem."\n
- display \n
- abort
-
- end
-
-
- #
- # INITIALIZE MODEM
- #
- # CHECK MODEM
- %n = %maxTries
- display "Initializing modem.."
- repeat
- display "."
- output $initstr\13
- %n = %n - 1
- if [input 3 OK\n]
- %success = 1
- else
- %success = 0
-
- end
-
- until %success | %n < 1
-
- # MODEM INITIALIZED OK
- if %success
- sleep 1
- display "Done."\n
- # MODEM FAILED TO INITIALIZE
- else
- display \007\n
- display "Modem failed to initialize properly."\n
- display "Ensure your setup SLIP PORT is the correct COM port for your modem."\n
- display \n
- abort
-
- end
-
-
- #
- # ATTEMPT TO DIAL
- #
-
- %n = %maxTries
- %success = 0
- display "Dialing Cycor Communications..." \n
-
- repeat
- display "Dialing..."$d_prefix$number \n
- output "atdt" $d_prefix $number \13
-
- # DECREMENT ATTEMPT COUNTER
- %n = %n - 1
-
- # CLEAR INPUT STREAM
- %timeout = [read 2 $result2]
-
- # PICK UP DIAL CODE
- %timeout = [read 5 $result2]
-
- # PICK UP SHORT-TMO ERRORS
- %timeout = [read 20 $result1]
-
- # PICK UP LONG-TMO ERRORS
- %timeout = [read 60 $result]
-
- # CONCAT INPUT STREAMS
- $result = $result + $result1 + $result2
-
- if pos("NO DIAL", $result) > 0
- display "No dial tone - is modem connected properly?" \n
- display "Waiting 25 seconds to retry..." \n
- sleep 25
-
- else
- if pos("CARRIER", $result) > 0
- display "No carrier - is phone number correct?" \n
- display "Waiting 25 seconds to retry..." \n
- sleep 25
-
- else
-
- if pos("BUSY", $result) > 0
- display "All lines are busy..." \n
- display "If this situation persists, please report it to "\n
- display "Cycor's Technical Support @ 1-(800)-AT-CYCOR."\n
- display "Waiting 25 seconds to retry..." \n
- sleep 25
-
- else
- if pos("CONNECT", $result) > 0
- %success = 1
-
- else
- # AN UNKNOWN ERROR OCCURRED
- %success = 0
- display "Could not properly connect... " \n
- display "Waiting 25 seconds to retry..." \n
- sleep 25
-
- end
-
- end
-
- end
-
- end
-
- until %n < 1 | %success
-
- # DIAL ATTEMPT(S) SUCCESSFUL
- if %success = 1
- display "Connected."\n
-
- # DIAL ATTEMPT(S) FAILED
- else
- display \007\n
- display "Connection NOT established. Perhaps all lines are busy?"\n
- display "Try again in a few minutes."\n
- abort
-
- end
-
-
- #
- # CONNECT TO ANNEX
- #
- # CONNECT TO ANNEX
- %n = %maxTries
- %n1 = %maxTries
- display "Establishing connection with Annex..."
- repeat
- repeat
- %success = [input 15 choice:]
- %n = %n - 1
- until %success | %n < 1
-
- # ANNEX CONNECTION SUCCESSFUL
- if %success
- output $service\13
-
- # ANNEX CONNECTION FAILED
- else
- display \007\n
- display "Could not log into Annex."\n
- display "The system may be temporarily down."\n
- display "Please try again in a few moments..."\n
- abort
-
- end
-
- # ATTEMPT TO LOG IN
- if %success
- %success = 0
- %n1 = %n1 - 1
- input 10 Username:
- query $user "Please enter your Cycor user id"
- output $user\13
- password "Password for user "$user
- output \p\13
-
- %timeout = [read 5 $result2]
- %timeout = [read 5 $result1]
- %timeout = [read 5 $result]
-
- $result = $result + $result1 + $result2
-
- if pos("CLI", $result)
- display \007\n
- display "Permission denied... Your Username or password was entered incorrectly." \n
-
- else
- %success = 1
- display \n
- display "You are now online!!!" \n
- display "Now minimize this application and the other Cycor"\n
- display "Internet applications are avaiable for you."\n
- display \n
- display "When you wish to log off, return to this application"\n
- display "and choose 'Bye' from the Dialer menu."\n
- display \n
-
- end
-
- else
- # ANNEX CONNECTION FAILED
- if %n < 1
- %n1 = 0
-
- end
-
- end
-
- until %success | %n1 < 1
-
- # COULD NOT LOG IN CORRECTLY
- if %success
- display "Online." \n
-
- else
- display \007\n
- display "Could not log in. Please try again." \n
- display "If you continue to experience difficulties getting connected,"\n
- display "contact Cycor's Techical Support @ 1-(800)-AT-CYCOR."\n
- abort
-
- end
-
-
-
- #
- # GO ONLINE
- #
-
- if $service = "3"
- # PPP Server
- online
- display \007\n
- display "Online."\n
- display \n
-
- else
- if $service = "2"
- # SLIP SERVER
- if [input 45 Your]
- # OBTAINED DYNAMIC IP ADDRESS
- if [address 15]
- online
-
- display \007\n
- display "Your IP address is "\I\n
- display "Online."\n
- display \n
-
- # COULD NOT OBTAIN DYNAMIC IP ADDRESS
- else
- display \007\n
- display "Error: Could not obtain IP address from server."\n
- display "If you continue to experience difficulties getting connected,"\n
- display "contact Cycor's Techical Support @ 1-(800)-AT-CYCOR."\n
- display \n
- abort
-
- end
-
- else
- # NO RESPONSE FROM ANNEX
- display \007\n
- display "Error: No reponse from Annex."\n
- display "The system may be down. If this problem persists,"\n
- display "Please report this to Cycor's Technical Support"\n
- display "line @ 1-(800)-AT-CYCOR."\n
- display \n
- abort
-
- end
-
- # INVALID SERVICE TYPE
- else
- display \007\n
- display "Error: An invalid service type was selected."\n
- display "Please re-install this package or contact Cycor"\n
- display "Technical Support @ 1-(800)-AT-CYCOR."\n
- display \n
- abort
-
- end
-
- end
-
-
- #
- # SAVE VARIABLES TO TRMPSWK.INI
- #
- save $user
-
-